Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding functionality to render a table from a HTML file #208

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Nelwhix
Copy link

@Nelwhix Nelwhix commented Jan 18, 2023

Completing one of the todos on the readme by adding the functionality to render table from html file. This PR adds a new dependency to the package: golang.org/x/net/html to help with parsing the html.

@olekukonko
Copy link
Owner

Can we have more test?

@mattn
Copy link
Collaborator

mattn commented Jul 7, 2023

Could you please add tests for broken html? Thanks.

@Nelwhix
Copy link
Author

Nelwhix commented Jul 7, 2023

@mattn I already added a test for when there are some unclosed tags. What other edge cases should I test for ?

@mattn
Copy link
Collaborator

mattn commented Jul 7, 2023

For example:

<tr>
 <td>foo</td>
</tr>
<tr>
 <th>bar</th>
</tr>

@Nelwhix
Copy link
Author

Nelwhix commented Jul 7, 2023

For example:

<tr>
 <td>foo</td>
</tr>
<tr>
 <th>bar</th>
</tr>

Okay added that, it returns :

// 	Output: *=====*
	// | BAR |
	// *=====*
	// | foo |
	// *=====*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants